﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using MovieRental_Presentation.Helpers;

namespace MovieRental_Presentation.Validation
{
    public class WebPageValidationRule : ValidationRule
    {

        public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
        {
            bool isValid = ComponentManager.Instance.MovieComponent.VerifyWebPage((string)value);
            return (isValid) ? new ValidationResult(true, null) : new ValidationResult(false, "Invalid web page.");
        }
    }
}
